cmake_minimum_required(VERSION 3.8)
project(multline_lidar)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()
include_directories(
  include
  ${Boost_INCLUDE_DIRS}
  ${PCL_LIBRARY_DIRS}
  ${EIGEN3_INCLUDE_DIR}
)

# 查找依赖
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(pcl_conversions REQUIRED)
find_package(PCL REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Sophus REQUIRED)
find_package(Ceres REQUIRED)
# 添加可执行文件
add_executable(multline_lidar src/process_title.cpp)
# 链接库
ament_target_dependencies(multline_lidar
  rclcpp
  sensor_msgs
  pcl_conversions
  tf2
  tf2_ros
)
target_link_libraries(multline_lidar 
    Eigen3::Eigen 
    Sophus::Sophus 
    ceres 
      ${PCL_LIBRARIES}
      )
# 安装规则
install(TARGETS
  multline_lidar
  DESTINATION lib/${PROJECT_NAME}
)      

ament_package()
